package cn.tx.receive;

/**
 * @author Mxb
 * @version 1.0
 * @date 2020/10/4 16:45
 */
//@Component
//@RabbitListener(queues = {"hello.queue"})
//public class MessageReceive {
//
//    @RabbitHandler
//    public void onMessage(String content, Message message, Channel channel) {
//        System.out.println("======收到消息，正在消费中======");
//        long deliveryTag = message.getMessageProperties().getDeliveryTag();
//        try {
//            channel.basicAck(deliveryTag, false);
//            System.out.println("签收成功：" + content);
//            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//            System.out.println("签收成功时间:" + sdf.format(new Date()));
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//    }
//}
